package net.uhuijia.user.userCart.service;

import net.uhuijia.appbase.service.BaseService;
import net.uhuijia.user.userCartItem.persistence.model.UserCartItem;
import net.uhuijia.user.usermall.persistence.model.UserMall;
import net.uhuijia.vo.cart.UserCartVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import net.uhuijia.appbase.service.CrudService;
import net.uhuijia.user.userCart.persistence.dao.UserCartDao;
import net.uhuijia.user.userCart.persistence.model.UserCart;
import net.uhuijia.user.userCart.persistence.model.UserCartExample;

import java.util.List;


@Service
@Transactional
public interface UserCartService
     extends BaseService<UserCart,UserCartExample> {

    /**
     * @Author xzj
     * @Description //添加购物车业务代码
     * @Date  2018/10/8
     * @Param
     * @return
     **/
    UserCartItem addCart(UserMall userMall , String spuId, Integer count, String propertyId);
    /**
     * @Author xzj
     * @Description //根据用户id和店铺Id查询UserCart
     * @Date  2018/10/8
     * @Param
     * @return
     **/
    UserCart getUserCartByUserIdAndShopId(String userId,String shopId);

    /**
     * @Author xzj
     * @Description //查询用户购物车数量
     * @Date  2018/10/8
     * @Param
     * @return
     **/
    int findUserCartCountByUserId(String userId);
    /**
     * @Author xzj
     * @Description //分页查询购物车店铺
     * @Date  2018/10/8
     * @Param
     * @return
     **/
    List<UserCart> findUserCartListByPageAndUserId(UserMall userMall , UserCartExample example);
    /**
     * @Author xzj
     * @Description //分页查询购物车店铺,并封装成VO返回数据
     * @Date  2018/10/8
     * @Param 
     * @return 
     **/
    List<UserCartVo> findCartListByUserIdAndPage(UserMall userMall , UserCartExample example);



}